package com.it235.seata.storage.service.impl;

import com.it235.seata.storage.mapper.StorageMapper;
import com.it235.seata.storage.service.StorageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 功能描述:
 *
 * @author: 李明杰
 * @date: 2022/1/18 0:21
 */
@Slf4j
@Service
public class StorageServiceImpl implements StorageService {

    @Autowired
    private StorageMapper storageMapper;

    @Override
    public boolean updateUseNum(long produceId, long used) {
//        int a=100/0;
        int index = storageMapper.updateUsed(produceId, used);

        return index > 0;
    }
}
